package com.example.bys.zyfypt_103Fbw.activity;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
import android.widget.ImageButton;
import android.widget.LinearLayout;

import com.example.bys.zyfypt_103Fbw.R;
import com.example.bys.zyfypt_103Fbw.bean.log.SessionIDBean;
import com.example.bys.zyfypt_103Fbw.fragment.follow.FollowFragment;

import java.util.ArrayList;
import java.util.List;

public class MyFollowActivity extends AppCompatActivity {

    private LinearLayout layout1,layout2,layout3,layout4,layout5;//用于界面切换
    private ImageButton ib1,ib2,ib3,ib4,ib5;//用户设置图片
    private ViewPager vp;//用于滑动切换
    private List<Fragment> listfragment;//Fragment  list
    private FragmentPagerAdapter fpadapter;//用来呈现Fragment页面
    private SessionIDBean sessionIDBean;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_my_follow);
        initFragment();//初始化Fragment相关
    }
    private void initFragment() {
        listfragment=new ArrayList<Fragment>();//实例化Fragment list
        //将Fragment加入到list中
        listfragment.add(new FollowFragment());
        //实例化FragmentPagerAdapter
        fpadapter=new FragmentPagerAdapter(getSupportFragmentManager()) {
            //获取某个Fragment
            @Override
            public Fragment getItem(int position) {
                return listfragment.get(position);
            }
            //确定Fragment数量
            @Override
            public int getCount() {
                return listfragment.size();
            }
        };
        vp=(ViewPager)findViewById(R.id.view_myfollow);//实例化ViewPager
        vp.setAdapter(fpadapter);//绑定ViewPager和Adapter
    }



}
